//
//  FavoriteCollectionViewCell.m
//  Cook
//
//  Created by 0.0 on 15-4-20.
//  Copyright (c) 2015年 dingjun. All rights reserved.
//

#import "FavoriteCollectionViewCell.h"

@implementation FavoriteCollectionViewCell

- (void)dealloc
{
    [_favoriteImageView release];
    [_favoriteNameLabel release];
    
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    
    if (self) {
        
        self.favoriteBackView = [[UIView alloc] initWithFrame:CGRectMake(10, 10, frame.size.width, frame.size.height)];
        _favoriteBackView.backgroundColor = [UIColor whiteColor];
        
        self.favoriteImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, frame.size.width - 10,  frame.size.height - 10)];
        _favoriteImageView.layer.shadowOffset = CGSizeMake(0, 0);
        _favoriteImageView.layer.shadowRadius = 2.0f;
        _favoriteImageView.layer.shadowOpacity = 0.5f;
//        _favoriteImageView.layer.opacity = 0.5f;
        self.favoriteNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(_favoriteImageView.frame.origin.x, _favoriteImageView.frame.origin.y + _favoriteImageView.frame.size.height, _favoriteImageView.frame.size.width, FavoriteItemHigth)];

        
        self.favoriteNameLabel.font = [UIFont systemFontOfSize:14.0f];
        self.favoriteNameLabel.textAlignment = NSTextAlignmentCenter;
        
//        self.favoriteNameLabel.backgroundColor = [UIColor yellowColor];
        
        [_favoriteBackView addSubview:_favoriteImageView];
        [_favoriteBackView addSubview:_favoriteNameLabel];
        [self.contentView addSubview:_favoriteBackView];
        
        [_favoriteBackView release];
        [_favoriteImageView release];
        [_favoriteNameLabel release];
    }
    
    return self;
}


@end
